/*
 * @Descripttion: 
 * @version: @ 1.0.0
 * @Author: ZJZ
 * @Date: 2021-06-24 15:22:54
 * @LastEditors: 朱江洲
 * @LastEditTime: 2022-05-10 10:51:46
 */
import request from "@/utils/request.js";


//查询登陆日志

export const getlogininfor = data => {
    return request({
        method: 'post',
        url: '/monitor/logininfor/list',
        data
    })
}

// 查询操作日志
export const getoperlog = data => {
    return request({
        method: 'post',
        url: '/monitor/operlog/list',
        data
    })
}


// 员工与部门管理
//获取员工与部门管理列表
export const getTreeselect = params => {
    return request({
        method: 'get',
        url: '/system/dept/treeselect',
        params
    })
}

// 获取用户列表
export const getList = params => {
    return request({
        method: 'get',
        url: '/system/user/list',
        params
    })
}
// 获取直属上级列表
export const getChargeList = params => {
    return request({
        method: 'get',
        url: '/system/user/chargeList',
        params
    })
}

// 获取组织列表
export const getDeptList = () => {
    return request({
        method: 'get',
        url: '/system/dept/list',
    })
}
// 获取角色

export const getRoleList = () => {
    return request({
        method: 'get',
        url: '/system/role/list',
    })
}
// 新增部门
export const newDept = data => {
    return request({
        method: 'post',
        url: '/system/dept',
        data
    })
}
// 删除部门
export const delDept = params => {
    return request({
        method: 'delete',
        url: '/system/dept/remove',
        params
    })
}
// 编辑部门
export const editDept = data => {
    return request({
        method: 'put',
        url: '/system/dept',
        data
    })
}
//新增用户
export const addUser = data => {
    return request({
        method: 'post',
        url: '/system/user',
        data
    })
}

// 修改用户
export const putUser = data => {
    return request({
        method: 'put',
        url: '/system/user',
        data
    })
}

// 删除用户
export const delUser = data => {
    return request({
        method: 'post',
        url: `/system/user/remove`,
        data
    })
}

// 重置密码
export const putPsd = data => {
    return request({
        method: 'put',
        url: `/system/user/resetPwd`,
        data
    })
}

// 冻结或者激活用户
export const changeStatus = data => {
    return request({
        method: 'put',
        url: `/system/user/changeStatus`,
        data
    })
}

// 下载模版

export const importTemplateUser = () => {
    return request({
        method: 'get',
        url: `/system/user/importTemplate`,

    })
}

// 导入用户

export const importData = data => {
    return request({
        method: 'post',
        url: `/system/user/importData`,
        data
    })
}

// 批量导出
export const exportByIds = data => {
    return request({
        method: 'post',
        url: `/system/user/exportByIds`,
        data
    })
}

// 角色权限管理
// 获取角色列表
export const getRoleLists = () => {
    return request({
        method: 'get',
        url: `/system/role/list`,
    })
}
// 角色用户查询

export const getRoleUserList = params => {
    return request({
        method: 'get',
        url: `/system/user/list`,
        params
    })
}
// 创建角色
export const addRole = data => {
    return request({
        method: 'post',
        url: `/system/role`,
        data
    })
}

// 角色权限查询
export const checkRole = params => {
    return request({
        method: 'get',
        url: `/system/role/query`,
        params
    })
}
// 角色权限更改
export const dataScope = data => {
    return request({
        method: 'put',
        url: `/system/role/dataScope`,
        data
    })
}


// 获取菜单权限
export const roleMenuTreeselect = params => {
    return request({
        method: 'get',
        url: `/system/menu/roleMenuTreeselect`,
        params
    })
}

// 角色菜单分配
export const putRoleAll = data => {
    return request({
        method: 'put',
        url: `/system/role`,
        data
    })
}
export const userAdd = data => {
    return request({
        method: 'post',
        url: `/system/role/userAdd`,
        data
    })
}

// 删除角色
export const romoveRole = params => {
    return request({
        method: 'get',
        url: `/system/role/remove`,
        params
    })
}

// 修改角色
export const editName = params => {
    return request({
        method: 'get',
        url: `/system/role/editName`,
        params
    })
}
// 更换角色
export const putRoleUser = data => {
    return request({
        method: 'put',
        url: `/system/role/editRole`,
        data
    })
}

// 登陆日志人员列表
export const getUserList = () => {
    return request({
        method: 'get',
        url: `/system/user/listAll`,
    })
}


// 获取模块
export const getModule = () => {
    return request({
        method: 'get',
        url: `/monitor/logininfor/getModule`,
    })
}


// 获取企业信息
export const getInfo = () => {
    return request({
        method: 'get',
        url: `/system/company/info`,
    })
}
// 更新企业log
export const updateLogo = data => {
    return request({
        method: 'post',
        url: `/system/company/updateLogo`,
        data
    })
}
// 更新企业执照
export const updateLicense = data => {
    return request({
        method: 'post',
        url: `/system/company/updateLicense`,
        data
    })
}

// 申请列表
export const applyList = params => {
    return request({
        method: 'get',
        url: `/system/user/applyList`,
        params
    })
}
// 同意
export const agree = data => {
    return request({
        method: 'post',
        url: `/system/user/agree`,
        data
    })
}
// 拒绝
export const refuse = params => {
    return request({
        method: 'get',
        url: `/system/user/refuse`,
        params
    })
}
// 删除
export const deleteApply = data => {
    return request({
        method: 'post',
        url: `/system/user/deleteApply`,
        data
    })
}

/**
 * crm更进
 */

// 列表
export const furtherList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/stepType/list`,
        params
    })
}

// 新增/更新
export const updateStepType = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/stepType/update`,
        data
    })
}

/**
 * 商机组状态
 */

// 获取商机组列表
export const optStatusList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/opportunityStatusGroup/list`,
        params
    })
}
// 删除商机组

export const deleteOptStatus = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/opportunityStatusGroup/delete`,
        params
    })
}

// 商机组列表
export const groupList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/opportunityStatusGroup/groupList`,
        params
    })
}

// 新增
export const insert = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/opportunityStatusGroup/insert`,
        data
    })
}

// 更新
export const updateInsert = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/opportunityStatusGroup/update`,
        data
    })
}
// 更改状态
export const chaStatus = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/opportunityStatusGroup/changeStatus`,
        params
    })
}


// 绑定用户列表
export const bindList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/binding/list`,
        params
    })
}
// 解绑
export const unRelate = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/binding/unRelate`,
        params
    })
}

// 绑定学校
export const spRelateS = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/binding/spRelateS`,
        params
    })
}

// 学校列表
export const showSpRelateS = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/binding/showSpRelateS`,
        params
    })
}
// 解绑学校
export const spUnRelateS = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/binding/spUnRelateS`,
        params
    })
}

// - 适应模块列表
export const adaptModuleList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/adaptModuleList`,
        params
    })
}

// - 新增模块
export const addModule = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/customNum/addModule`,
        data
    })
}

// - 模块启用关闭
export const enable = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/customNum/enable`,
        data
    })
}
// - 模块删除
export const deleteModule = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/deleteModule`,
        params
    })
}

// - 模块列表
export const moduleList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/moduleList`,
        params
    })
}
// 模块详情
export const detailModule = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/list`,
        params
    })
}
// 模块编辑
export const editModule = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/customNum/edit`,
        data
    })
}

// - 适应草稿模块列表
export const adaptDraftList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/adaptDraftList`,
        params
    })
}

// - 草稿模块列表
export const draftList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/draftList`,
        params
    })
}
// - 新增草稿模块
export const addDraftModule = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/customNum/addDraftModule`,
        data
    })
}
// - 编辑草稿模块
export const editDraftModule = data => {
    return request({
        method: 'post',
        url: `/serviceProvide/customNum/editDraftModule`,
        data
    })
}

// 关联商机
export const aboutList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/aboutList`,
        params
    })
}

// - 关联商机
export const aboutEnable = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/aboutEnable`,
        params
    })
}
// - 展示新增合同/回款时的编号输入框
export const showCodeInput = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/contract/showCodeInput`,
        params
    })
}
// 回款计划查询
export const recoveryAboutList = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/recoveryAboutList`,
        params
    })
}
// 更换状态
export const recoveryAboutEnable = params => {
    return request({
        method: 'get',
        url: `/serviceProvide/customNum/recoveryAboutEnable`,
        params
    })
}